﻿using Microsoft.AspNetCore.Mvc.Filters;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace WebAPI_DEMO.Filter
{
    /// <summary>
    /// 操作过滤器/筛选器
    /// </summary>
    public class GlobalActionFilter : IActionFilter
    {
        public void OnActionExecuted(ActionExecutedContext context)
        {
            //LogHelper.Info("OnActionExecuted");
            //执行方法后执行这
            //记录请求后时间-请求前
        }

        public void OnActionExecuting(ActionExecutingContext context)
        {
            //LogHelper.Info("OnActionExecuting");
            //执行方法前先执行这
            //记录请求前
        }
    }
}
